Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
Beginner on QlikView, I need help to create a table that I can't do,
I would like to have something like this (with Total) :
But in my table on QlikView, text data "CP" and "CM" are not displayed.
I put like Expression :
=if(jour = 11 and [temps prod]='CP','CP',
if(jour = 11 and [temps prod]='CM','CM',
Interval( sum(if(jour = 11, [temps prod])) ,'hh:mm:ss')
)
)
in attached my QVW file and below the txt data,
Thanks in advance for your help
DATA.txt :
Agent;agentid;Start;temps;
Agent1;1104;11/03/19 08:00;07:00:00
Agent2;1030;11/03/19 07:00;06:00:00
Agent3;1226;11/03/19 08:00;07:00:00
Agent4;1070;11/03/19 11:00;07:00:00
Agent5;1146;11/03/19 08:00;07:00:00
Agent6;1225;11/03/19 08:00;07:00:00
Agent7;1018;11/03/19 08:00;09:00:00
Agent8;1197;11/03/19 12:00;07:00:00
Agent9;1186;11/03/19 CP;CP
Agent10;1167;11/03/19 08:00;07:00:00
Agent11;1036;11/03/19 08:00;06:00:00
Agent12;1058;11/03/19 08:00;07:00:00
Agent13;1037;11/03/19 CM;CM
Agent14;1103;11/03/19 08:00;06:00:00
Agent15;1122;11/03/19 08:00;05:00:00
Agent1;1104;12/03/19 11:00;07:00:00
Agent2;1030;12/03/19 08:00;07:00:00
Agent3;1226;12/03/19 08:00;07:00:00
Agent4;1070;12/03/19 08:00;07:00:00
Agent5;1146;12/03/19 08:00;07:00:00
Agent6;1225;12/03/19 08:00;07:00:00
Agent7;1018;12/03/19 08:00;09:00:00
Agent8;1197;12/03/19 08:00;07:00:00
Agent9;1186;12/03/19 CM;CM
Agent10;1167;12/03/19 12:00;07:00:00
Agent11;1036;12/03/19 08:00;06:00:00
Agent12;1058;12/03/19 07:00;07:00:00
Agent13;1037;12/03/19 CP;CP
Agent14;1103;12/03/19 08:00;06:00:00
Agent15;1122;12/03/19 08:00;05:00:00
Just call that filed in expression of straight table
load * Inline [
s1,s2
t,2
3,4
1,c
2,d
];
I have looked at things up, down and sideways, and I cannot figure out what the heck is wrong either, Agent 9 and 13 are not appearing, and the above poster is incorrect, changing the Totals does NOT fix the underlying issue of Agent 9 and 13 not appearing here, but I cannot figure out what is wrong either. I am hoping by posting this, maybe someone else will be able to have a look that is a better developer than am I and spot what we are missing here! 🙂 Sorry I do not have a fix for you.
Regards,
Brett
It is likely "misbehaving" because the expression has to evaluate more than one line to execute the expression and one line has the "CP" or "CM" in the Temps Prod field and one line does not. this of it like this.
We can test this. First start with no selections.
Now make a selection... Notice in the chart where you have selections, the value populates correctly. This is likely due to the fact that when you select Jour 11, the expression is evaluating a single line.
I don't have the time today to figure out the correct solution. However, I can tell you that you have to find a way for your expression to evaluate a single for your nested IF statement to work. The alternative would be to come up with a different expression, perhaps Set Analysis can be used. I was able to get the following formula to work in a test instance.
IF((sum({$< jour = {11}>} [temps prod]))<=0, 'CM',
Interval(sum({$< jour = {11}>} [temps prod]),'hh:mm:ss' ))
I have also attached the QVW file I altered for you.
Nate