Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear community,
I found problem for script below, the FlightNumber is always showing 1...
FlightNumber:
Load Fltno,
[Flt Dt],
Count(distinct Fltno) * Count(distinct [Flt Dt])) as FlightNumber
resident FlightData
group by [Flt Dt], Fltno;
I think count distinct might not work in this way in script, anyone knows to workaround to overcome this?
it is working fine in expression in chart.
For special reason, i cannot have expression in the chart, i need a (number of flight) field,
so that the chart can directly use the field.
(limitation of GeoQlik flow chart, only can use field, expression is not working)
I need the number of flight field can corresponding to the filter selection. just like the figure show in blue text box.
Thanks and best regards,
Chanel
Hi,
Try any of this expressions
=Sum(Aggr(1, Fltno, [Flt Dt]))
or
= count(DISTINCT Fltno & Ceil([Flt Dt]))
Regards,
Jagan.
What exact Calculation do you want over there?
You are taking distinct Fltno and [Flt Dt] for each record. So they both always give 1 and hence 1*1=1.
Hi
Since you are grouping by Fltno and Flt Dt, the distinct counts will always be 1, so the count distinct is working correctly. What are you trying to do? Perhaps you should explain how you would like to determine FlightNumber.
Regards
Jonathan
It seems not a calculation issue.
Better you put some of your sample data and sample output you want from that, it'll describe the problem in a better way.
Manideep HV, Jonathan Delpino Awlad Hossain, I have attached the example document with explanation why I need to in this way.
Kindly assist.
Thanks and best regards,
Chanel
Hi,
Try this script and check
Data:
LOAD Cabin,
DOW,
[Flt Wk Dt],
[Flt Dt],
Fltno,
Region,
Route,
DepIATA,
DestIATA,
DestIATA2,
Origin,
Destination,
ASK,
RPK
FROM
[..\1_Resources\Map\sampledata for QC troubleshooting.xlsx]
(ooxml, embedded labels, table is Sheet2);
FlightNumber:
Load Fltno,
//count(Fltno) as FlightNumber
(Count(distinct Fltno) * Count(distinct [Flt Dt])) as FlightNumber
resident Data
group by Fltno;
Regards,
Jagan.
Hi Jagan,
Thanks for fast response, one step closer now. but it still looks not working correctly as shown in attachment.
We should get 112 flights for KUL-SIN route, but we can see 12 and 14 in [number of flight] field.
Thanks and best regards,
Chanel
Hi,
Can you attach some sample data?
Regards,
Jagan.
Hi Jagan,
I have attached the sample data in last reply named as sampledata for QC troubleshooting.xlsx
Thanks and best regards,
chanel
Hi,
We are doing Group by Flight Number, so you are getting 12 and 14, if you want 112 then you need do Group by using Route dim.
FlightNumber:
Load Route,
//[Flt Dt],
//count(Fltno) as FlightNumber
(Count(distinct Fltno) * Count(distinct [Flt Dt])) as FlightNumber
resident Data
group by Route;
Regards,
Jagan.