Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
AKS_Qlik
Partner - Contributor
Partner - Contributor

Multiple expression for dimension value in straight table

Hello,

I need to represent below data in a straight table.

The tittle column would be be a inline/excel load.

In the below scenario each tittle value has a different logic for calculation.

Currently i create three expression's to display Çurrent Year'value for corresponding dimension value.

How can 'Previous Year' and 'Difference ' be represented?

 

 

TittleCurrent YearPrevious YearDifference
Gross margin / Tel .Sales %500400100
Gross margin / Concession Sales %600500100
Gross margin / Main Stores Sales %900300600
1 Solution

Accepted Solutions
Taoufiq_Zarra

@AKS_Qlik 

you can use ValueList function

for example with this data set :

LOAD * INLINE [
ID
1
2
2
3
];

Add Calculated Dimension...  with for example :

=ValueList('KPI1','KPI2','KPI3')

and Mesures :

=pick(match(ValueList('KPI1','KPI2','KPI3'),'KPI1','KPI2','KPI3')
, sum(ID)

,count(ID)

, sum(ID)*count(ID)
)

so each row is a # mesures

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

6 Replies
Taoufiq_Zarra

can you share your sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Or
MVP
MVP

Check the InYear() and InYearToDate() functions. You can shift those to get the previous year(s) and you can subtract e.g. LYTD from YTD to get the difference.

AKS_Qlik
Partner - Contributor
Partner - Contributor
Author

Hello,

The issue is not with writing or using any function.Each row has a different logic.

How can i generate a second column as expression for each dimension value?

AKS_Qlik
Partner - Contributor
Partner - Contributor
Author

Hello Taoufiq,

The issue is for each row of the dimension the logic is different .Each row is a KPI.

Attached is another snapshot.In the attached scenario for 18 KPI's, 18 expression have been incorporated.

How can another column of expression be included to display values?

 

 

 

KPI.JPG

Taoufiq_Zarra

@AKS_Qlik 

you can use ValueList function

for example with this data set :

LOAD * INLINE [
ID
1
2
2
3
];

Add Calculated Dimension...  with for example :

=ValueList('KPI1','KPI2','KPI3')

and Mesures :

=pick(match(ValueList('KPI1','KPI2','KPI3'),'KPI1','KPI2','KPI3')
, sum(ID)

,count(ID)

, sum(ID)*count(ID)
)

so each row is a # mesures

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
AKS_Qlik
Partner - Contributor
Partner - Contributor
Author

Thanks Taoufiq for your timely response.Its working fine as per expectation!