Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
antonopn
Contributor III
Contributor III

Set analysis reference to each table's dimension or PICK/IF?

Hi everyone,

Still writing here, though ChatGPT is already solving many of the problems. But here also looking to your perspectives, not only get some useful code.

I have some batches, manufactured yearly and I need to see their cost per year. So I need to see the "batch-2015" cost for 2015,2016 etc. Four years ahead. I can do it with pivot as below, but I was trying to find a more elegant/flexible solution.

See below.

 qlik_reference_to_dim.jpg

I tried with Set analysis, but I think it is not possible. For example 

 

 

sum({<Year = {$(=right(BatchName,4)))} >} Cost)

 

 

 

Any idea how should I approach this? Should I do it in pivot, or straight table with conditional logic (PICK/IF)?

Thanks in afvance  

Labels (1)
2 Replies
marcus_sommer
MVP
MVP

I think it shouldn't be solved within the UI else within the data-model. For example with something like this:

...
CostYear - BatchStartYear + 1 as #Year
...

which just calculates the offset between the years.

antonopn
Contributor III
Contributor III
Author

Thank you for the reply. I will try it