Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Athulya
Contributor II
Contributor II

Creating Dynamically Changing Column Names

Hi!

I am trying to create a report that provides running data over the past 5 business days. This is how the data/report looks as of today:

Athulya_0-1598998333783.png

Tomorrow, it would be:

Athulya_1-1598998507966.png

 

This output comes from a SQL script that generates the data. As can be seen, the column names change daily based on today's date. Attached is the SQL script that has been used to generate the above.

To me, it looks like I should be using variables. If so, could I please get guidance on how it could be done? And if this isn't the right approach, then what could it be? I also have a little difficulty in completely understanding the script, however, I believe I understand enough of the code to be able to use integrate it to Qlik.

Thanks,

Athulya

1 Solution

Accepted Solutions
marcus_sommer

Your table is a crosstable. Such a data-structure has usually much more disadvantages then benefits. Therefore I suggest to transform it into a "normal" data-structure with a crosstable-load (respectively if I interpret your sql right, it intentionally creates this pivot-view from a probably normal table-structure - if so then skip it and load the data directly).

Within an associated master-calendar you may flag your last n days which is then used as selection or as a set analysis condition.

- Marcus 

View solution in original post

2 Replies
marcus_sommer

Your table is a crosstable. Such a data-structure has usually much more disadvantages then benefits. Therefore I suggest to transform it into a "normal" data-structure with a crosstable-load (respectively if I interpret your sql right, it intentionally creates this pivot-view from a probably normal table-structure - if so then skip it and load the data directly).

Within an associated master-calendar you may flag your last n days which is then used as selection or as a set analysis condition.

- Marcus 

Athulya
Contributor II
Contributor II
Author

Hi Marcus,

Thanks for the reply.  With respect to data load, I did what you suggested and loaded the data as is, then created the Pivot table in Qlik instead of loading it as a pivot table (Basically, pivoted the dates). Thanks for the suggestion!

Regards,

Athulya