Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
h_prakash
Creator II
Creator II

Set Analysis to Show Un Associated Records In Qlik Sense

Hi I have a Requirement  in the Qlik Sense

I have two tables

Project Details:

  

ProjectStandar Year
12015
22016
32017

Amount Details:

   

ProjectAmount YearAmount
1201610
1201720
1201830
2201640

   

I have a  Amount Year Filter where user will select as 2017

He wants a  table to like this

  

ProjectAmount
120
30

He Wants 3 Project as Standard Year equals to Amount year with Amount as 0.

Please help in this regard.

Thanks

Hari

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi Hari,

Try like this

ProjectDetails:

LOAD * INLINE [

    Project, Actual Year, Dummy

    1, 2015, 0

    2, 2016, 0

    3, 2017, 0

];

AmountDetails:

LOAD * INLINE [

    Project, Fiscal Year, Amount

    1, 2016, 10

    1, 2017, 20

    1, 2018, 30

    2, 2016, 40

];

=Sum({<[Fiscal Year]={$(=Max([Fiscal Year]))}>} Amount) + Sum({<[Fiscal Year]=, [Actual Year]={$(=Max([Fiscal Year]))}>} Dummy)

Regards,

Jagan.

View solution in original post

11 Replies
sunny_talwar

May be this

Sum({<[Amount Year] = p([Standard Year])>}Amount)

rubenmarin

Hi Hari, maybe with:

Sum(Amount)+Sum({1<Project=p({1<[Standar Year]=P([Amount Year])>} Project)>} 0)

And uncheking 'supresss zero-values' in presentation tab.

Not applicable

May be table concatenation will work with out complex SET Analysis expression.

jagan
Luminary Alumni
Luminary Alumni

Hi Hari,

Try like this

ProjectDetails:

LOAD * INLINE [

    Project, Actual Year, Dummy

    1, 2015, 0

    2, 2016, 0

    3, 2017, 0

];

AmountDetails:

LOAD * INLINE [

    Project, Fiscal Year, Amount

    1, 2016, 10

    1, 2017, 20

    1, 2018, 30

    2, 2016, 40

];

=Sum({<[Fiscal Year]={$(=Max([Fiscal Year]))}>} Amount) + Sum({<[Fiscal Year]=, [Actual Year]={$(=Max([Fiscal Year]))}>} Dummy)

Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

You can also try

=Sum({<[Fiscal Year]={$(=Max([Fiscal Year]))}>} Amount) + Sum({<[Fiscal Year]=, [Actual Year]={$(=Max([Fiscal Year]))}>} 0)

h_prakash
Creator II
Creator II
Author

Thank You for the response. But Still Facing the issue. I am getting Null in the Amount.

jagan
Luminary Alumni
Luminary Alumni

Hi Hari,

You can also try P()

=Sum({<[Fiscal Year]={$(=Max([Fiscal Year]))}>} Amount) + Sum({<[Fiscal Year]=, [Actual Year]=P([Fiscal Year])>} 0)


Regards,

Jagan.

rubenmarin

Hi Hari, have you checked the example attached? It works there so, what's the diffeence between the data in that sample and your document?

antoniotiman
Master III
Master III

Hi,

Maybe this in Script

[Project Details]:
LOAD * Inline [
Project, Standard Year
1, 2015
2, 2016
3, 2017]
;
Join LOAD * Inline [
Project, Amount Year, Amount
1, 2016, 10
1, 2017, 20
1, 2018, 30
2, 2016, 40]
;
LOAD Project,If(Len(Trim([Amount Year]))=0,[Standard Year],[Amount Year]) as [Amount Year],
If(Len(Trim([Amount Year]))=0,0,Amount) as Amount
Resident [Project Details];
Drop Table
[Project Details];

Regards,

Antonio