Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
naziralala
Contributor

Re: CSV File Leading Zeros and 0  in display

Yes. That is correct.

So, what is the solution?

Thanks.

Nazira

Partner
Partner

Re: CSV File Leading Zeros and 0  in display

This might help you: (see attached document)

Partner
Partner

Re: CSV File Leading Zeros and 0  in display

Did this help naziralala‌ ?

If so, please mark as correct / helpfull 🙂

naziralala
Contributor

Re: CSV File Leading Zeros and 0  in display

No. It has not solved the issue.

Thanks.

Highlighted
Partner
Partner

Re: CSV File Leading Zeros and 0 in display

In what sense didn't it work?

Have you implemented the code I sended?

Perhaps an idea to share your app, so we can give you better support...?

naziralala
Contributor

Re: CSV File Leading Zeros and 0  in display

Yes. i implemented the code, but the output did not change. In my case, it does not work.

When I tried using

'="'&[Code]&'"' as [Code]

it gives me the leading 0's but the other fields do not display correctly.

I am trying to get a csv file as output. My code is below:

[SGroup]:

LOAD

  [A Code],

  [Dep Year] as [Travel Year],

  [Book Date] as [G Booking Date],

  GuFlag as GFlag,

  [Group] as [G Group],

  [G Total Price]  as [Total Price]

  Resident [Creator]

  Where GuFlag='Y' and match(left([A Code],1),'0', '1', '2');

left Join ([SGroup])

LOAD

  

  [A Code],

  [G Group Name] as [GroupNme]

  Resident Light;

//Output Calculation By Group

Let vCurrYear=Year(Today()); //2016

[OutpuGGroup(2015 and 2016)] :

LOAD

  [A Code],

  [GroupNme] as [GroupName],

  [G Group] as [GGroup] ,

  [A Code]&'-'&[GroupNme]&'-'&[G Group] as Key,

  sum([Total Price]) as [CYBookingR]

Resident [SGroup]

  WHERE [Travel Year] = $(vCurrYear)  //2016

  Group By [A Code],[GroupNme],[G Group]; 

Let vCurrYear=($(vCurrYear)-1); //2015

Join ([OutpuGGroup(2015 and 2016)])

       

Load [A Code],

  [GroupNme] as [GroupName],

  [G Group] as [GGroup] ,

  [A Code]&'-'&[GroupNme]&'-'&[G Group] as Key,

  sum([Total Price]) as [PYBookingR]

Resident [SGroup]

WHERE [Travel Year] = $(vCurrYear) //2015

   

    Group By [A Code],[GroupNme],[G Group];

Gout:

Load    //'="'&[A Code]&'"' as [A Code],

[A Code],

  //'="'&[GroupName]&'"' as [GroupName],

  [GroupName],

  //="'&[GGroup]&'"' as [GGroup],

  [GGroup],

  //'="'&Key&'"' as Key,

  Key,

  if(IsNull([PYBookingR]),0,[PYBookingR]) as [B.PYBooking R],

  if(IsNull([CYBookingR]),0,[CYBookingR]) as [B.CYBooking R]

Resident [OutpuGGroup(2015 and 2016)] ;

left join

Load    //'="'&[A Code]&'"' as [A Code],

[A Code],

  //'="'&[GroupName]&'"' as [GroupName],

  [GroupName],

  //="'&[GGroup]&'"' as [GGroup],

  [GGroup],

  //'="'&Key&'"' as Key,

  Key,

      

        num(if([B.PYBooking R]= 0 and [B.CYBooking R]=0,0,

         if([B.PYBooking R]<> 0, [B.CYBooking R]/[B.PYBooking R]-1, 1.00)),'#,##0.00') as [B.YOY R]

  Resident Gout ;

Drop Table [OutpuGGroup(2015 and 2016)];

Drop field Key from Gout;

//Store '="'&[A Code]&'"' as [A Code],

Store [A Code],

  [GroupName],

  [GGroup],

  [B.PYBooking R] as [PYBooking R],

      

        [B.CYBooking R] as [CYBooking R]

       

//Store *

From Gout

INTO [$(vOutfile2016)](txt);

Drop Table Gout;

Drop Table [SGroup];