Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld happening right now! You can still join: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
arieln93
Contributor II
Contributor II

condition to a dimension in load script

Hi! 

I need help with a customer requirement.

There are two cost centers that were discontinued this year, and the client wants to see only until the last month of life of these cost center (there are real data, budgets and adjustments for both centers) . 

I made a link table,and I'm thinking there to do the condition where.

In normal words it would be something like this:
"where, cost center 1 is until May 2019 and cost center 2 until August 2019".
the other cost centers should still be shown anyway.

it's possible?

thanks!

1 Solution

Accepted Solutions
arieln93
Contributor II
Contributor II
Author

I did!

I finally came up with this idea.
Remove those cost centers first and then I add them with the condition of the dates.

 

 

Captura.PNG

View solution in original post

4 Replies
xufei123
Partner
Partner

I will exclude the data after June in the fact table in the script.

When loading the fact table, I will do like this:

 

FactTable:

load field 1, field 2... from somesource

where not (([Cost centre]=1 and Date>'31/05/2019') or ([Cost centre]=2 and Date>'31/05/2019') );

The where clause is all you need, right?

 

Fei

 

arieln93
Contributor II
Contributor II
Author

I did!

I finally came up with this idea.
Remove those cost centers first and then I add them with the condition of the dates.

 

 

Captura.PNG

arieln93
Contributor II
Contributor II
Author

xufei123

Thanks for your help.

Your idea is very similar to what occurred to me later ! 😄

xufei123
Partner
Partner

Same result with loading once and use this, right?

Where not ((CC='863' and @PeriodoNum>= 40909 and @PeriodoNum<43586) or (CC='861' and @PeriodoNum>= 40909 and @PeriodoNum<43586));