Can QS use Custom SQL to create another Customer SQL Unpivot date

I am trying to unpivot data from another datasource which use customer sql query. Can I use that datasource which use customer sql query as the base to create a new unpivot dataset?

Hi @yingkz
you want to unpivot the dataset1 with SQl?
Why not rewrite the custom SQL of dataset1 to unpivot it in dataset2?
BR

@ErikG because the 1st custom sql is complicated and trying to base on output to unpivot it.

Hi @yingkz
what if creating a view with sql1 and transpose it with sql2?
BR

@ErikG
I currently duplicated original custom sql and create a custom SQL logic under the original custom sql to unpivot it. but in this case, original custom sql can unpivot custom sql are completely different datasets no relationships. I am trying to based on first custom sql dataset to unpivot the table. Do you know if QS have this option?

Hi @yingkz
you could use SQL to unpivot but you can’t unpivot a dataset or use SQL on a QS dataset.
If that’s what you meant.
Best practice is anyway keep as much logic as possible on data side.
BR

Hi @yingkz
did you found a solution?
BR

Since we have not received a response from you on this question, we are going to archive the question. If you still need this question answered, please create a new question topic